Debugging Python: Solving 'ValueError: could not convert string to float